﻿import kliment.display.MCC;
import kliment.events.Event;
import kliment.utils.FileType;
import mx.events.EventDispatcher;
/**
 * ...
 * @author	Kliment
 * @version	1.2.7
 */
class kliment.display.loader.LoaderAbstract {
	private var _target_mc:MovieClip;
	private var _url:String;
	private var _isLoadInit:Boolean = false;
	private var _fileType:String;
	private var _progressInfo:Object;
	
	public function LoaderAbstract(target_mc:MovieClip) {
		_target_mc = target_mc;
		EventDispatcher.initialize(this);
	}
	
	public function load(url:String):Void {
		_fileType = FileType.define(url);
		_url = url;
		_isLoadInit = false;
	}
	
	public function get url():String { return _url }
	
	public function get target_mc():MovieClip { return _target_mc }
	
	public function get isLoadInit():Boolean { return _isLoadInit }
	
	public function get fileType():String { return _fileType }
	
	public function getBytesLoaded():Number { return _progressInfo.bytesLoaded; }
	
	public function getBytesTotal():Number { return _progressInfo.bytesTotal; }
	
	public function addEventListener(eventType:String, handler:Function):Void {  }
	
	public function dispatchEvent(event:Event):Void {  }
	
	public function removeEventListener(eventType:String, handler:Function):Void {  }
	
	public function toString():String {
		return "[LoaderAbstract target_mc=" + _target_mc + "]";
	}
	
	public function remove():Void {
		MCC.remove(_target_mc);
		_isLoadInit = false;
		delete this;
	}
}